package tests;

import common.AutoTestUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.security.spec.ECParameterSpec;
import java.time.Duration;

public class ListPage extends AutoTestUtils {
    public static String url = "http://120.26.160.116:8080/blog_list.html";

    public ListPage() {
        super(url);
    }

    /**
     * 未登录状态
     */
    public void listNoLogin(){
        noLoginPage();
    }

    /**
     * 登录状态下, 正确展示
     */
    public void listSuc(){
        driver.findElement(By.cssSelector("body > div.container > div.right"));
        driver.findElement(By.cssSelector("body > div.container > div.left > div > div:nth-child(4) > span:nth-child(1)"));
        driver.findElement(By.cssSelector("#pageContainer"));
        webDriverWait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("#pageContainer > li:nth-child(1) > a")));
    }
}
